/**
 * Test algorithms for JettHoughts
 * 
 * Created 12/02/2012
 * 
 * @author Vasili Svirski
 * @version 0.01
 */

package com.jetthoughts.tests;

import static org.junit.Assert.*;

import java.util.List;

import org.junit.Test;

import com.jetthoughts.algorithms.SortWords;

public class SortWordsTest {

	@Test
	public void simpleTest1() {
		List<String> sorted = SortWords.Sort("Cheers to You and Us");
		assertEquals(sorted.get(0), "and");
		assertEquals(sorted.get(1), "Cheers");
		assertEquals(sorted.get(2), "to");
		assertEquals(sorted.get(3), "Us");
		assertEquals(sorted.get(4), "You");
	}

	@Test
	public void simpleTest2() {
		List<String> sorted = SortWords.Sort("artur and Anton");
		assertEquals(sorted.get(0),"Anton");
		assertEquals(sorted.get(1),"and");
		assertEquals(sorted.get(2),"artur");
	}

	@Test
	public void simpleTest3() {
		List<String> sorted = SortWords.Sort("anton Nes antenu Anton");
		assertEquals(sorted.get(0),"Anton");
		assertEquals(sorted.get(1),"antenu");
		assertEquals(sorted.get(2),"anton");
		assertEquals(sorted.get(3),"Nes");
	}
}
